<%@ page contentType="text/html;charset=UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext['request'].contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns=http://www.w3.org/1999/xhtml>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户注册 -- ${applicationScope.sysconfig.system_name }</title>
<SCRIPT type="text/javascript" src="${ctx }/static/js/jquery.min.js"></SCRIPT>
	<!-- bootstrap -->
	<link rel="stylesheet" type="text/css" media="screen"
		href="${ctx }/static/bootstrap/css/bootstrap.css">
	<link rel="stylesheet" type="text/css" media="screen"
		href="${ctx }/static/bootstrap/css/bootstrap-responsive.css">
<STYLE type="text/css">
</STYLE>
</head>
<body>
<c:choose>
	<c:when test="${step == '1' }">
			填写用户名：<input type="text" name="username" id="username"/>
			<input type="button" onclick="go_next()" value="下一步"/>
			<script type="text/javascript">
				var go_next = function() {
					var uname = $("#username").val();
					if(uname == "") {
						alert("请填写要找回密码的用户名");
						return false;
					}
					window.location.href="${ctx}/user/home/forget_pwd?step=2&username="+uname;
				}
			</script>
	</c:when>
	
	<c:when test="${step == '2' }">
			邮箱提示：<b>${email }</b>,<br/>
			请根据提示填写您注册时的邮箱：
			<form action="${ctx }/user/home/forget_pwd" method="post">
				<input type="text" name="email" id="email"/>
				<input type="hidden" name="username" id="username" value="${username }"/>
				<input type="hidden" name="step" value="3"/>
				<input type="submit" value="下一步"/>
			</form>
	</c:when>
	
	<c:when test="${step == '3' }">
		验证邮件已发至 <b>${email }</b>, 请在24小时内通过邮件找回密码
	</c:when>
	
	<c:when test="${step == '4' }">
		<form action="${ctx }/user/home/forget_pwd" method="post">
			填写新密码：<input type="password" name="new_pwd" id="pwd"/><br/>
			确认新密码：<input type="password" name="re_pwd" /><br/>
			<input type="hidden" name="step" value="5"/>
			<input type="hidden" name="email" value="${email }"/>
			<input type="hidden" name="t" value="${t }"/>
			<input type="hidden" name="sign" value="${sign }"/>
			<input type="submit" value="完成"/>
		</form>
	</c:when>
	
	<c:when test="${step == '5' }">
		 密码已更改， 请使用新密码<a href="${ctx }/user/_login">重新登录</a> 
	</c:when>
	
	<c:otherwise>
		<b>出错啦~~~， 请联系管理员</b>
	</c:otherwise>
</c:choose>
</body>
</html>